1. Field of the Invention
The present invention relates to high efficient coding method and apparatus for performing compression of video data (dynamic image signal) at the time of transmitting or recording the video data.
2. Description of Related Art
An information amount of video data is enormous. In order to efficiently transmit (hereinbelow, the word xe2x80x9ctransmitxe2x80x9d is used to represent also recording of data to a recording medium) the video data in a small information amount, various high efficient coding methods have been proposed.
For example, in an interframe predictive coding, an error between video data of the present frame and a prediction value obtained from video data in the frame which is N (N is a natural number) frames before or after the present frame is obtained as predictive error data and only the predictive error data is encoded by a variable length coding process.
According to this method, an amount of information to be transmitted can be largely compressed relative to that of the original video data. In the interframe predictive coding, however, a large prediction error can occur in a dynamic range in video data, to degrade the picture quality. In order to prevent it, an interframe motion compensation predictive coding is performed.
In the interframe motion compensation predictive coding, to obtain a prediction error between frames as described above, a motion vector is first obtained by using block matching as disclosed in Japanese Patent Kokai No. 8-65684.
In the block matching, first, one block consisting of, for example, (16xc3x9716) pixels in one frame is set as a target block for a motion vector detection and a predetermined region including the target block is specified as a search region. In the search region, while shifting a search block consisting of (16xc3x9716) pixels of the same size as that of the target block every pixel, the sum of the absolute value of a difference between each pixel value in the target block and each pixel value in the search block in the frame which is N (N is a natural number) frames before or after the target frame is obtained every search block. Among the search blocks, the search block which provides the smallest sum is detected and a vector directing from the center of the target block toward the center of the detected search block is obtained as a motion vector. When the series of operations is finished, a block obtained by shifting the target block only by one pixel is used as a new target block and the series of operations is executed again. By executing the operations for one frame, a plurality of motion vectors are obtained.
When the motion vector is obtained, a difference between a pixel value at the position of a movement destination that is predicted by the motion vector and a pixel value at the position of a moving source in the frame which is N (N is a natural number) frames before or after the target frame is obtained as a predictive difference and the predictive difference is subjected to a DCT (discrete cosine transform) process and a quantizing process. Data obtained by the quantizing process is encoded by a variable length coding and the resultant data is transmitted as an encoded video data.
In the block matching, however, as for such video data that a luminance level of the whole frame changes with the lapse of time as in the case of a fade-in or fade-out, an erroneous motion vector is detected. When the motion vector detection is performed by the block matching, therefore, the luminance level of the video data is successively corrected so that the luminance level change in association with the elapse of time as mentioned above does not occur, and the block matching is executed by using the video data in which the luminance has been corrected.
When the encoded video data obtained by performing those countermeasure is decoded and an image is displayed, there however arises a problem such that a flicker occurs in an image of, for example, a scene of the sea or sky in which the number of clear outlines is small.
The invention has been made to solve this problem and it is an object of the invention to provide method and apparatus for coding video data at high efficiency, in which even from video data at the time of fade-in or fade-out, encoded video data which does not degrade the picture quality upon decoding can be obtained.
According to the invention, there is provided a high efficiency video data coding apparatus for obtaining encoded video data by encoding original video data at high efficiency, comprising: luminance adjusting means for obtaining luminance adjusted video data by adjusting a luminance of the original video data; motion vector detecting means for detecting a motion vector from the luminance adjusted video data when an image based on the original video data is in a fade-in or fade-out state and many outline components are included in the image and detecting the motion vector from the original video data when the number of outline components in the image is small; and an encoder for encoding the original video data by a motion compensation prediction according to the motion vector, thereby obtaining the encoded video data.
According to the invention, there is provided a high efficiency video data coding method for encoding original video data at high efficiency by using a motion compensation prediction according to a motion vector, comprising the steps of: detecting the motion vector from luminance adjusted video data obtained by adjusting a luminance of the original video data when an image based on the original video data is in a fade-in or fade-out state and many outline components are included in the image; and detecting the motion vector from the original video data when the number of outline components included in the image is small.